%@ Language=VBScript %> <%' (c) Copyright 1999-2004 PaperCut Software Pty. Ltd. %> <% Dim objPCWebUsers Set objPCWebUsers = Server.CreateObject("PCWebAdmin.PCWebUsers") If objPCWebUsers.Error Then WriteErrorMessage objPCWebUsers.ErrorDescription End If Function GetChargeError(intError) Dim s If intError = 0 Then ' No error s = "" ElseIf intError = 3 Then s = GetText("ErrorTransInvAmount") ElseIf intError = 4 Then s = GetText("ErrorUnexpectedError") s = s & " - " & objPCWebUsers.ErrorDescription End If GetChargeError = s End Function Dim blnIsValidUser Dim strChargeUser Dim strCreditText Dim strComment Dim strCharge Dim intRow strChargeUser = LCase(Trim(Request("txtChargeUser"))) strComment = Trim(Request("txtAdditionalComment")) strCharge = Trim(Request("cboCharge")) Dim curAmount If (IsNumeric(Trim(Request("txtAmount")))) then curAmount = CCur(Trim(Request("txtAmount"))) End If If strChargeUser <> "" Then objPCWebUsers.SeekUser(strChargeUser) If (UCase(objPCWebUsers.UserName) = UCase(strChargeUser)) then blnIsValidUser = True strCreditText = objPCWebUsers.CreditText End If End If If Request("blnSubmitted") <> "" Then Dim strFullComment If strCharge = "ChargeTypeOther" Then strFullComment = GetText("ChargeTypeOther") Else strFullComment = strCharge End If If strComment <> "" Then strFullComment = strFullComment & " - " & strComment End If objPCWebUsers.SeekUser(strChargeUser) If (UCase(objPCWebUsers.UserName) <> UCase(strChargeUser)) then ' No match. WriteErrorMessage GetTextReplace("ErrorCantFindUser", Array(strChargeUser)) Else ' Charge If objPCWebUsers.ChargeUser(curAmount, strFullComment) Then RedirectWithMessage "UserList.asp?strUsername=" & Server.URLEncode(strChargeUser), GetText("ChargeApplied") Else WriteErrorMessage GetText("UnableToCharge") & " " & GetChargeError(objPCWebUsers.ProcessErrorNo) End If End If End If %>